package com.sdx.console.contract.entity;

import java.util.Date;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.beetl.sql.core.annotatoin.ColumnIgnore;
import org.beetl.sql.core.annotatoin.AutoID;
import org.beetl.sql.core.annotatoin.SeqID;
import org.apache.commons.lang3.StringUtils;
import com.ibeetl.admin.core.util.ValidateConfig;
import com.sdx.service.ConfigService;

import org.beetl.sql.core.TailBean;
import java.math.*;

import com.ibeetl.admin.core.annotation.Dict;
import com.ibeetl.admin.core.entity.BaseEntity;

import org.beetl.sql.core.annotatoin.InsertIgnore;
import org.beetl.sql.core.annotatoin.Version;
import org.beetl.sql.core.annotatoin.LogicDelete;
import com.sdx.common.utils.Utils;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;

/* 
* 
* gen by Spring Boot2 Admin 2019-03-25
*/
@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
@Data
public class ContractInfo extends BaseEntity{

    //合同id
    @NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class)
    @AutoID	
    private Integer contractId ;
	
    //合同号
    private String invoiceNo ;
	
    //家长id
    private String customerId ;
	
    //家长姓名
    private String customerName ;
	
    //家长手机号
    private String customerPhone ;
	
    //家长身份证
    private String customerIdcard ;
	
    //学生姓名
    private String studentName ;
	
    //学生手机号
    private String studentPhone ;
	
    //高考年份
    private Integer graduateYear ;
	
    //签单老师
    private String seller ;
	
    //服务老师
    private String servant ;
	
    //学生就读信息：{"prov": "省份","city": "城市","borough": "区县","school": "某高中","grade": "高一","classes": "2班","gender": "男/女","majorType": "文/理/不分文理"}
    private String schoolExt ;
	
    //退费约定：{"refund1": "金额1","refund2": "金额2","refund3": "金额3","trans": "是否转为志愿填报服务"}
    private String refundExt ;
	
    //发票需求：0:不需要,1:需要
    private Integer openTicket ;
	
    //签署合同日期/修改订单时间
    private Date optDate ;
	
    //合同总金额
    private BigDecimal contractAmt ;
	
    //支付时间
    private Date payTime ;
	
    //合同路径
    private String urlPdf ;
	
    //合同状态：0:新建,1已审核,2:已签,3:作废
    private Integer htStatus ;
	
    //付款状态：0:待付款,1:已付款,2:已确认
    private Integer fkStatus ;
	
    //服务状态：0:未开启,1:进行中,2:已结束
    private Integer fwStatus ;
	
    //退款状态：0:待申请,1:待审核,2:退款中,3:已退款,4:不退款
    private Integer tkStatus ;
	
    //服务评价：{"score": "5星","content": "评语"}
    private String comment ;
	
    //录单日期
    private Date createDate ;
	
    //服务备注
    private String remark ;


    //预约类型名称
    @ColumnIgnore
    private  String fwteacherName;

    @ColumnIgnore
    private  String qdteacherName;

    private String contractMember;

    //更新人

    private Integer updatedBy ;

    //更新人名称

    private String updatedName ;

    //更新时间

    private Date updatedTime ;

    private Date startTime;

    private Date endTime;

    private Long userId;

    private Long orgId;

    private String createdTimeQuery;

    public void setCreatedTimeQuery(String createdTimeQuery) {
        this.createdTimeQuery = createdTimeQuery;
        Date[] timePair = Utils.parseQueryTime(createdTimeQuery);
        if (timePair!=null && timePair[0]!=null) {
            this.startTime = timePair[0];
        }
        if (timePair!=null && timePair.length==2 && timePair[1]!=null) {
            this.endTime = timePair[1];
        }
    }


}
